package com.shelpe.services.sinbad.entity.jpa;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.IdClass;
import lombok.Data;
import com.shelpe.services.sinbad.entity.jpa.ProductImages.ProductImagesPK;

@Entity(name="product_imags")
@IdClass(ProductImagesPK.class)
@Data
public class ProductImages {
	
	@Id
	@Column(name="num_iid")
	private long productID;
	@Id
	@Column(name="position")
	private Integer position;
	@Column(name="user_id")
	private long userID;
	@Column(name="url")
	private String url;
	@Column(name="id")
	private Long imageId;
	@Column(name="update_time")
	private Date updateTime;
	
	@Data
	public static class ProductImagesPK implements Serializable {
		private static final long serialVersionUID = 1L;
		@Id
		@Column(name="num_iid")
		private long productID;
		@Id
		@Column(name="position")
		private Integer position;
	}
}
